<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>注册页面</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/register.css">
    <script src="js/register.js" type="module" charset="utf-8"></script>
</head>
<body>
    <section>
        <aside class="img_box"></aside>
        <h1 style="text-align:center;margin-top:70px;">用户注册</h1>
        <fieldset>
            <legend hidden>用户注册</legend>
            <form action="login.Servlet?param=doRegister" method="post">
                <table>
                    <tbody>
                        <tr>
                            <td><label for="userName">用户名：</label></td>
                            <td><input type="text" name="username" id="userName" placeholder="请输入4到16位的数字或字母"></td>
                            <td>
                                <nav class="error_block">
                                    <div class="error_img" id="usererror_img"></div>
                                    <div class="error_msg" id="usererror_msg" >
                                        
                                    </div>
                                </nav>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="userName">昵称：</label></td>
                            <td><input type="text" name="nicheng" id="nicheng"></td>
                            <td>
                                <nav class="error_block">
                                    <div class="error_img" id="nichengimg"></div>
                                    <div class="error_msg" id="nichengmsg">
                                           
                                    </div>
                                </nav>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="userName">密码：</label></td>
                            <td><input type="password" name="password" id="password"></td>
                            <td>
                                <nav class="error_block">
                                    <div class="error_img" id="pderror_img"></div>
                                    <div class="error_msg" id="pderror_msg"></div>
                                </nav>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="userName">再输入一次：</label></td>
                            <td><input type="password" name="rePassword" id="rePassword"></td>
                            <td>
                                <nav class="error_block">
                                    <div class="error_img" id="againerror_img"></div>
                                    <div class="error_msg" id="againerror_msg"></div>
                                </nav>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="userName">email：</label></td>
                            <td><input type="email" name="email" id="email"></td>
                            <td>
                                <nav class="error_block">
                                    <div class="error_img" id="email_error_img"></div>
                                    <div class="error_msg" id="email_error_msg"></div>
                                </nav>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="phone">手机号：</label></td>
                            <td>
                                <input type="text" name="phone" id="phone">
                            </td>
                            <td>
                                <nav class="error_block">
                                    <div class="error_img" id="phone_error_img"></div>
                                    <div class="error_msg" id="phone_error_msg"></div>
                                </nav>
                            </td>
                        </tr>
						<tr>
							<td>性别：</td>
							<td colspan="2"><input type="radio" name="sex" value="1"
								id="man"> <label for="man">男</label>&nbsp; <input
								type="radio" name="sex" value="2" id="woman"> <label
								for="woman">女</label></td>
						</tr>
						<tr>
							<td>爱好：</td>
								<td colspan="2">
								<table>
									<tr>
							<c:forEach items="${requestScope.hobby }" var="hobby" varStatus="status">
								<td><input type="checkbox" name="hobbies" value="${hobby.code }" id="${hobby.code }"> 
								<label for="${hobby.code }">${hobby.name }</label>&nbsp;</td>
									<c:if test="${(status.index+1)%4==0 }"></tr><tr></c:if>
							
							</c:forEach>
									</tr>
								</table>
								</td>
						</tr>	
						<tr>
							<td>籍贯：</td>
							<td colspan="2">
							<select id="province">
							<c:forEach items="${requestScope.nativeplace }" var="natic">
							<option value="${natic.code }">${natic.name }</option>
							</c:forEach>
							</select>&nbsp; 
							<select id="city" name="cityCode"></select>
							</td>
						</tr>
						<tr>
                            <td>照片：</td>
                            <td colspan="2">
                                <input type="file" name="photo" accept="image/*">
                            </td>
                        </tr>
                        <tr>
                            <td>生日：</td>
                            <td colspan="2">
                                <input type="date" name="birthday">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <nav style="text-align: center;margin-top:50px;">
                                    <button type="reset">重置</button>&nbsp;&nbsp;
                                    <button type="submit">注册</button>
                                </nav>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </fieldset>
    </section>
</body>

</html>
